<?php
    session_start();		
	include("TableDataGateway/TDGEscogerEditarAnuncio.php");
	$TDG = new TDGEscogerEditarAnuncio();
	
	/*if(!empty($_POST['Abrir']) ){
		$_SESSION['Anuncio'] = $_POST['Anuncios'];
		header('Location: editaranuncio.php');
	}*/
	
	$result = $TDG-> obtenerAnuncios($_SESSION['id']);		
	$numrows = mysql_num_rows($result);

	/*if($_SESSION['listaCarpetas'] == NULL){
		$_SESSION['listaCarpetas'] = array();
		array_push($_SESSION['listaCarpetas'], 5);
		$_SESSION['pos'] = 0;
	}else{
		if(!empty ($_POST['Abrir'])){
			array_push($_SESSION['listaCarpetas'], $_POST['Carpetas']);
			$_SESSION['pos']++;
		}
	}

	if(!empty($_POST['Regresar'])){
		if($_SESSION['pos'] != 0){
			$_SESSION['pos'] --;
			array_pop($_SESSION['listaCarpetas']);
		}
	}*/
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>Vitamina U</title>
        <meta name="keywords" content="itinerary, list" />
        <meta name="description" content="This page provides a list of all itineraries" />
        <link href="css/default.css" rel="stylesheet" type="text/css" />
    </head>
    
    <body>
		<div id="wrapper">
        <?php include 'include/header2.php'; ?>
            <!-- end div#header -->
            <div id="page2">
                <div id="content">
                    <div id="welcome">
                        <center><h1>Editar Anuncio</h1></center>
							<form id="form_datos" action="editaranuncio.php" method="POST">
								<H2>Seleccione uno de sus anuncios</H2><br/>
								<select name = "Anuncios">								
								<?php
								$i = 0;
								while($i < $numrows){							
									$Nombre = mysql_result($result, $i, "NombreProyecto");
									$ID = mysql_result($result, $i, "ID");
								?>									
									<option id="<?php echo $ID; ?>" name="<?php echo $ID; ?>" Value="<?php echo $ID; ?>"><?php echo $Nombre; ?></option>								
								<?php
								$i++;
								}
								?>								
								</select>
								&nbsp&nbsp
								<input class="form_submitb" type="submit" name="Abrir" id="Abrir" value="Abrir Anuncio"/>
							</form><br/>
							
							
                    </div>
                    
                    <!-- end div#welcome -->			
                    
                </div>
                <!-- end div#content -->
				
                <div style="clear: both; height: 1px"></div>
            </div>
            <?php include 'include/footer2.php'; ?>

        </div>
        <!-- end div#wrapper -->
    </body>
</html>